import React from 'react'
import Top from '../components/top'
import Bottom from '../components/bottom'
import {useState,useEffect} from "react"
import axios from '../utils/axios'
function App() {
   let [arr,setArr] = useState([])
   useEffect(()=>{
       axios.get("/list").then(res=>{
           setArr(res.data)
       })
   },[])
  return (
    <div>
        {
            arr && arr.length? <Top arr={arr}></Top>:"暂无数据"
        }
        {
              arr && arr.length?   <Bottom arr={arr} color={"yelow"}></Bottom> :"暂无数据"
        }
      
    </div>
  )
}

export default App